package beans.page;

import models.common.user.DASUser;
import models.midas.form.BaseFormBean;

import org.codehaus.jettison.json.JSONArray;
import org.codehaus.jettison.json.JSONObject;

public abstract class BasePageWrapper{
	protected JSONArray buttons;
	protected ButtonsFactoryP2 buttonBuilder;
	
	public BasePageWrapper(BaseFormBean bean, DASUser user){
		buttons = new JSONArray();
		buttonBuilder = new ButtonsFactoryP2(bean,user);
	}
	
	public JSONArray getButtons(){
		return buttons;
	}
	
	protected BasePageWrapper withButton(AbstractButton button) {
		String _button = button.getButton();
		if (_button != null) {
			buttons.put(_button);
		}
		return this;
	}
}
